<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<base href="<%=basePath%>">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>茶叶 | 真伪验证</title>
<style type="text/css">
body { background-color: #eeeeee; margin: 0 auto; text-align: center;  }
#header, #content { border: 2px solid #DDD; width: 970px; background-color: white; margin: 0 auto; margin-top: 3px; }
#content { height: 700px; margin-top: 5px; }
.navigator { 
	display: block; 
	width: inherit;
	height: 20px;
	padding: 5px 5px 5px 5px;
	text-decoration: none; 
	color: #333;
}
.navigator:hover {
	background-color: #ddd;
}
.selected { background-color: #CCC; }
</style>
<script type="text/javascript" src="js/jquery-1.6.1.min.js"></script>
<script type="text/javascript">
function ajaxValidate() {
	var code = $("#codeInput").attr("value");
	$.ajax({
		type: "POST",
		url: "antifake/validate",
		data: "code=" + code,
		dataType: "json",
		success: function(data){
			$("#validateResultDiv").empty().append(data.msg);
		}
	});
}
</script>
</head>

<body>
<div align="center" id="header" >
  <div align="left" style="padding-left: 20px;"><h1>茶叶防伪与追溯门户</h1>诚信为本，追求卓越，精益求精，缔造永恒</div>
  <table width="970" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td width="*" height="28">&nbsp;</td>
      <td width="113" height="28" align="center"><a href="index.jsp" class="navigator">首页</a></td>
      <td width="113" height="28" align="center"><a href="trace.jsp?first=true" class="navigator">茶叶追溯</a></td>
      <td width="113" height="28" align="center"><a href="javascript:void(0)" class="navigator selected">商品真伪验证</a></td>
      <td width="15" height="28" align="center">&nbsp;</td>
    </tr>
  </table>
</div>
<div align="left" id="content" style="text-align: center;">
	<br/><br/>
	<fieldset style="width: 800px; height: 500px; text-align: left; margin: 0 auto;">
		<legend><h2>商品防伪验证</h3></legend>
		<h4>该功能的目的是让消费者不受假冒伪劣产品的蒙蔽，请按照以下步骤操作:</h4><br/>
		<div id="validateForm" style="margin-left: 15px;">
			请输入商品内置的防伪码，并点击验证：<br/>
			<div style="margin-top: 14px;">
				<input style="width: 400px;" name="code" id="codeInput"/>&nbsp;<button onclick="ajaxValidate(); return false;">&nbsp;&nbsp;验证&nbsp;&nbsp;</button>
			</div>
			<div id="validateResultDiv" style="margin-top: 14px; color:red; font-size: 15px;">
			
			</div>
		</div>
	</fieldset>
</div>
</body>
</html>
